<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<script type="text/javascript" src="<c:url value="js/jquery-easyui-1.5.4.2/jquery.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="js/jquery-easyui-1.5.4.2/jquery.easyui.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="js/jquery-easyui-1.5.4.2/locale/easyui-lang-zh_CN.js"/>"></script>
<link id="theme" rel="stylesheet" type="text/css"  href="<c:url value="js/jquery-easyui-1.5.4.2/themes/ui-cupertino/easyui.css"/>"/>
<link  rel="stylesheet" type="text/css" href="<c:url value="js/jquery-easyui-1.5.4.2/themes/icon.css"/>"/>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>合同员工修改</title>
</head>
<body>
<script type="text/javascript">
		$(function(){
			//文本框验证金额
			$.extend($.fn.validatebox.defaults.rules, {    
				money:{
			          validator: function (value, param) {
			               return (/^(([1-9]\d*)|\d)(\.\d{1,2})?$/).test(value);
			           },
			           message:'请输入正确的金额'

			        }
			});
			 
			
			
			//返回上一级事件
			$(".contract_update_back").linkbutton({
				onClick:function(){
					$("#contract_panel_yj").panel({
						href:"to_ContractManagement"
						
					});
				}
			});
			//打开员工信息页面
			$('#emp_id_read').textbox({
						icons: [{
							iconCls:'icon-add',
							handler: function(e){
								$("#jobplanq").dialog("open");
							}
						}]
			});
			//模糊查询员工
			$("#searchjhb").linkbutton({onClick:function(){
				var name = $("#jhmssss").textbox("getText");
				$("#ygxxcx").datagrid("load","find-like_staffbouns-yj?name="+name)
				$("#jhmssss").textbox("setText","");
			}});
			//双击员工表格赋值
			$("#ygxxcx").datagrid({
				onDblClickRow:function(index,row){
					var stainid = row.stainId;
					$.getJSON("find-one-staffbouns-yj",{"stainid":stainid},function(v){
						$("#emp_id_read").textbox("setValue",v.stainId);
						$("#stainName").textbox("setText",v.stainName);
						$("#zcName").textbox("setText",v.zcName);
						$("#dutyName").textbox("setText",v.dutyName);
						$("#defideName").textbox("setText",v.defideName);
						$("#empimg").attr("src",v.stainSrc);
						$("#contract-hetong-jieshu-date-yj").datetimebox("setValue",v.stainEstimatedate);
						$("#jobplanq").dialog("close");
						
					});
				}
			});
			
			
			
			
			
			//打开合同信息页面
			$('#contract_type_update_yj').textbox({
				icons: [{
					iconCls:'icon-add',
					handler: function(e){
						$("#contract_hetong").dialog("open");
						$("#contract_update_yg_yj").datagrid("reload");
					}
				}]
			});
			//模糊查询合同信息			
			$("#searchjhb2").linkbutton({onClick:function(){
				var name = $("#contract_jhm2").textbox("getText");
				$("#contract_update_yg_yj").datagrid("load","like_ContractCategory_all?concaName="+name)
				$("#contract_jhm2").textbox("setText","");
			}});
			
			//双击合同信息表格赋值
			$("#contract_update_yg_yj").datagrid({
				onDblClickRow:function(index,row){
					var id = row.concaId;
					$.getJSON("find-one-contract-yj",{"id":id},function(v){
						$("#contract_type_update_yj").textbox("setValue",v.concaId);
						$("#contract_type_update_yj_yj").textbox("setText",v.concaName);
						$("#contract_hetong").dialog("close");
					});
				}
			});
			//点击添加按钮时提交
			$(".contract_insert_add").linkbutton({onClick:function(){
				$('#update_contract_admin_yj').form({
					onSubmit:function(param){
						return $(this).form('validate')
					},
					success:function(v){
						if(v){
							$("#contract_panel_yj").panel({
								href:"to_ContractManagement"
								
							});
						}else{
							$.messager.alert('错误', '对不起，操作失败，原因：' + v.message);
						}
					}
				}).submit();
			}});
		})
</script>
<div id="toolbar_contract_insert_insert">
		<a href="#" class="easyui-linkbutton contract_update_back" data-options="iconCls:'icon-add',plain:true,text:'返回',iconAlign:'left'"></a>
</div>
<div id="contract_table" class="easyui-panel" data-options="fit:true">
	<div style="width:1000px;height:600px;margin-top:15px;margin-left:15px;font-size:13px;">
		<div style="font-size:12px;">概要</div>
		<div style="border-top:2px solid #19aa8d;width:800px;height:1px;clear:both;"></div>
		<div style="width:420px;height:520px;float:left;margin-right:15px;">
			<form id="update_contract_admin_yj" action="update_contract_admin_yj" method="post">
				<table cellspacing="10">
					<tbody>
						<tr>
							<td align="right" width="100px">员工编号</td>
							<td>
							<input type="hidden" name="id" value="${con.conadId}">
							<input name="id1"  id="emp_id_read" class="easyui-textbox" data-options="required:true" value="${con.staffInformation.stainId}"/>
							</td>
						</tr>
						<tr>
							<td align="right">员工姓名</td>
							<td><input id="stainName" class="easyui-textbox"  value="${con.staffInformation.stainName}" readonly/></td>
						</tr>
						<tr>
							<td align="right">员工职称</td>
							<td><input id="zcName" class="easyui-textbox" value="${con.staffInformation.professionalTitle.zcName}"  readonly/></td>
						</tr>
						<tr>
							<td align="right">员工职务</td>
							<td><input id="dutyName" class="easyui-textbox" value="${con.staffInformation.duty.dutyName}"  readonly/></td>
						</tr>
						<tr>
							<td align="right">所在部门</td>
							<td><input id="defideName" class="easyui-textbox" value="${con.staffInformation.definitionDept.defideName}"  readonly/></td>
						</tr>
						<tr>
							<td align="right" width="100px">合同类型</td>
							<td>
								<input  name="id2"  id="contract_type_update_yj" value="${con.contractCategory.concaId}" class="easyui-textbox" data-options="width:'60px',required:true"/>
								<input id="contract_type_update_yj_yj" class="easyui-textbox"  value="${con.contractCategory.concaName}" data-options="width:'100px'"/>
							</td>
						</tr>
						<tr>
							<td align="right">合同开始时间</td>
							<td><input type= "text" class= "easyui-datetimebox" name="t" id="contract-hetong-money-yj" 
							 data-options="editable:false,required:true" value="${con.conadStarttime}" /></td>
						</tr>
						<tr>
							<td align="right">合同结束时间</td>
							<td><input class= "easyui-datetimebox" name="t2" data-options="editable:false,required:true"
							 id="contract-hetong-date-yj" value="${con.conadEndtime}" /></td>
						</tr>
						<tr>
							<td align="right">合同期限时间</td>
							<td><input class= "easyui-datetimebox" name="t3" data-options="editable:false,required:true"
							 id="contract-hetong-date-yj" value="${con.conadTryoutendtime}" /></td>
						</tr>
						<tr>
							<td align="right">试用结束时间</td>
							<td><input class= "easyui-datetimebox" name="t4" data-options="editable:false,required:true"
							 id="contract-hetong-jieshu-date-yj" value="${con.conadTerm}" /></td>
						</tr>
						<tr>
							<td align="right">合同内容</td>
							<td>
								<input class="easyui-textbox" name="remarks" data-options="width:'300px',height:'60px'" value="${con.conadContent}">
							</td>
						</tr>
						<tr>
							<td align="right">备注</td>
							<td>
								<input class="easyui-textbox" name="beizhu" data-options="width:'300px',height:'60px'" value="${con.conadRemarks}">
							</td>
						</tr>
					</tbody>
				</table>
			</form>
		</div>
		<div style="width:400px;height:200px;float:left;margin-left:40px">	
			<table cellspacing="10">
				<tbody>
					<tr>
						<div style="height:10px;"></div>
						<div style="width:230px;height:160px;"><img src="${con.staffInformation.stainSrc}" id="empimg" width="230px" height="160px"></div>
					</tr>
				</tbody>
			</table>
		</div>
		<div style="border-top:2px solid #19aa8d;width:800px;height:10px;clear:both;"></div>
		<a class="easyui-linkbutton contract_insert_add" style="margin-left:30px;width:100px;">添加</a>
	</div>
</div> 
    <div class="easyui-dialog" id="jobplanq" data-options="width:550,height:300,title:'员工信息',
				modal:true,
				closed:true
				">
					<div class="line">
						<input class="easyui-textbox" id="jhmssss" name="plandescribe" data-options="label:'员工名称',width:300">
						<a class="easyui-linkbutton" id="searchjhb" data-options="text:'搜索'"></a>
					</div>
					<div class="line">
						<table id="ygxxcx" width="100%" height="200px" class="easyui-datagrid zpjttksuo" data-options="
							pagination:true,
							pageSize:5,
							pageList:[5,10,15,20,25],
							autoRowHeight:true,
							nowrap:false,
							rownumbers:true,
							singleSelect:true,
							striped:true,
							url:'find-staffbouns-yj',
							fitColumns:true">
							<thead>
							  <tr>
								<th width="20%" data-options="align:'center',field:'stainId'">员工编号</th>
								<th width="20%" data-options="align:'center',field:'stainName'">员工名称</th>
								<th width="20%" data-options="align:'center',field:'defideName'">员工部门</th>
								<th width="20%" data-options="align:'center',field:'zcName'">员工职称</th>
								<th width="20%" data-options="align:'center',field:'dutyName'">职务</th>
							  </tr>
							</thead>
							<tbody>
							  
							</tbody>
						</table>
					</div>
			</div>
	 <div class="easyui-dialog" id="contract_hetong" data-options="width:550,height:300,title:'合同信息',
					modal:true,
					closed:true
					">
					<div class="line">
						<input class="easyui-textbox" id="contract_jhm2" name="plandescribe" data-options="label:'合同名称',width:300">
						<a class="easyui-linkbutton" id="searchjhb2" data-options="text:'搜索'"></a>
					</div>
					<div class="line">
						<table id="contract_update_yg_yj" width="100%" height="200px" class="easyui-datagrid zpjttksuo" data-options="
							pagination:true,
							pageSize:5,
							pageList:[5,10,15,20,25],
							autoRowHeight:true,
							nowrap:false,
							rownumbers:true,
							singleSelect:true,
							striped:true,
							url:'ContractCategory_all',
							fitColumns:true">
							<thead>
							  <tr>
								<th width="50%" data-options="align:'center',field:'concaId'">合同编号</th>
								<th width="50%" data-options="align:'center',field:'concaName'">合同名称名称</th>
							  </tr>
							</thead>
							<tbody>
							  
							</tbody>
						</table>
					</div>
</div>

</body>
</html>